<!DOCTYPE html>
<html>
    <head lang="en">
        <meta charset="UTF-8">
        <title></title>
       
    </head>
    <body>
        <script>
            function demo(){
                var a=10;
                var b=20;
                var sum=a+b;
                alert(sum);
            }
        </script>
        <!-- demo()调用 -->
        <button onclick="demo()">提交</button>
       
    </body>
</html>